﻿
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
		String path = request.getContextPath();
		String basePath = request.getScheme() + "://" + request.getServerName()
				+ ":" + request.getServerPort() + path + "/";
%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>main</title>
<LINK href="./css/style.css" type=text/css rel=stylesheet>
<LINK href="./css/main.css" type=text/css rel=stylesheet>
<script src="./js/WebCalendar.js" type="text/javascript"></script>
<script src="./js/main.js" type="text/javascript"></script>
<script src="./js/jquery-1.7.2.min.js" type="text/javascript"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #5CB7FE;
}
.STYLE1 {font-size: 12px}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
.STYLE5 {font-size: 12px; color: #FF0000; }
.STYLE6 {
	font-size: 16px;
	font-weight: bold;
}
-->
 </style>
</head>
<script language="javascript">
	function fn_delete(id){
		if(confirm("你确定要删除该生产线吗?")) {
			window.location="prodLineMgr!delete.action?id="+id;
		}
	}
	function fn_edit(id, lineName, node2IP, node3IP, node6IP, node4IP){
		frm = document.getElementById("prodLineMgr");
		frm.bt_smt.value = "修改生产线";
		frm.lineName.value = lineName;
		frm.node2IP.value = node2IP;
		frm.node3IP.value = node3IP;
		frm.node6IP.value = node6IP;
		frm.node4IP.value = node4IP;
		frm.action = "prodLineMgr!edit.action?id="+id;
	}
	function check() {
		frm = document.getElementById("prodLineMgr");
		if (frm.lineName.value == "") {
			frm.lineName.focus();
			alert("生产线名称不能为空");
			return false;
		}
		if (frm.node2IP.value!="" && !validateIp(frm.node2IP.value)) {
			alert("上线节点IP地址不正确!");
			return false;
		}
		if (frm.node3IP.value!="" && !validateIp(frm.node3IP.value)) {
			alert('下线节点IP地址不正确!');
			return false;
		}
		if (frm.node6IP.value!="" && !validateIp(frm.node6IP.value)) {
			alert('返修上线节点IP地址不正确!');
			return false;
		}
		if (frm.node4IP.value!="" && !validateIp(frm.node4IP.value)) {
			alert('返修下线节点IP地址不正确!');
			return false;
		}
	}
	function validateIp(ip){
         var patrn = /^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$/;
         if(!patrn.exec(ip))
         {
             return false;
         }
         return true;
    }
</script> 

<body style="overflow-x:hidden">
<table width="100%" height="568" border="0" cellpadding="0"
	cellspacing="0" bordercolor="#D8EDFF">
	<!--DWLayoutTable-->
	<tr>
		<td height="8" colspan="4" valign="top"></td>
		<td width="834" valign="top"></td>
		<td width="5" valign="top"></td>
	</tr>
	<tr>
		<td height="5" colspan="3" align="right" valign="top"><img
			src="images/icon1.jpg" width="6" height="5" /></td>
		<td colspan="2" valign="top"><img src="images/icon2.jpg" width="100%"
			height="5" /></td>
		<td valign="top"><img src="images/icon3.jpg" width="5" height="5" /></td>
	</tr>
	<tr>
		<td width="7" height="523">&nbsp;</td>
		<td width="5" align="right" valign="top" background="images/icon5.jpg"><img
			src="images/icon5.jpg" width="5" height="5" /></td>
		<td colspan="2" valign="top" bgcolor="#D8EDFF">&nbsp;</td>
		<td valign="top" background="images/main_bg.png">
		
		<table width="100%" border="0" cellpadding="0" cellspacing="0"
			bgcolor="#D8EDFF">
			<!--DWLayoutTable-->
			<tr>
				<td height="30" colspan="3" valign="middle"><span class="STYLE1">&nbsp;[生产线管理]</span></td>
				<td width="29">&nbsp;</td>
			</tr>
			<tr>
				<td height="59" colspan="3" align="center" valign="middle" class="STYLE6">生&nbsp;&nbsp; 产&nbsp;&nbsp; 线&nbsp;&nbsp;管&nbsp;&nbsp;理</td>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td width="90" height="345">&nbsp;</td>
				<td width="90%" valign="top">
		<form name="prodLineMgr" id="prodLineMgr" method="post" action="prodLineMgr!add.action" onSubmit="return　check();">
			 <fieldset>
   				 <legend class="STYLE1"><img alt="管理" src="images/edit.gif"/> &nbsp;&nbsp;生产线信息</legend>
   				 <s:if test="msg != null"> 
   				 	<div id="msg">
   				 		<table>
   				 			<tr>
   				 				<td width="1%"><img src="images/error.gif"></td>
   				 				<td>&nbsp;&nbsp;<span id="msgText"><s:property value="msg"/></span></td>
   				 				<td width="1%"><img src="images/close.png" alt="关闭" style="cursor:pointer;" onclick="closeMsgBox()"/></td>
   				 			</tr>
   				 		</table>
   				 	</div>
					</s:if>
					<table>
						<tr>
						  <td width="120" align="right" valign="middle" nowrap="nowrap"><span class="STYLE1">生产线名称：</span></td>
						  <td width="122" valign="middle"><input name="lineName" id="lineName" type="text" size="16" maxlength="20" style="width:100px; height:18px;" value=""></td>
						  <td width="120" align="right" valign="middle" nowrap="nowrap"><span class="STYLE1">上线节点IP：</span></td>
						  <td width="122" valign="middle"><input name="node2IP" id="node2IP" type="text" size="16" maxlength="20" style="width:100px; height:18px;" value=""></td>
						  <td width="120" align="right" valign="middle" nowrap="nowrap"><span class="STYLE1">下线节点IP：</span></td>
						  <td width="122" valign="middle"><input name="node3IP" id="node3IP" type="text" size="16" maxlength="20" style="width:100px; height:18px;" value=""></td>
					  	</tr>
					  	<tr>
						  <td width="120" align="right" valign="middle" nowrap="nowrap"><span class="STYLE1">返修上线节点IP：</span></td>
						  <td width="122" valign="middle"><input name="node6IP" id="node6IP" type="text" size="16" maxlength="20" style="width:100px; height:18px;" value=""></td>
						  <td width="120" align="right" valign="middle" nowrap="nowrap"><span class="STYLE1">返修下线节点IP：</span></td>
						  <td width="122" valign="middle"><input name="node4IP" id="node4IP" type="text" size="16" maxlength="20" style="width:100px; height:18px;" value=""></td>
						  <td></td>
						  <td><input name="bt_smt" id="bt_smt" type="submit" class="btn1_mouseout" onMouseOver="this.className='btn1_mouseover'" onMouseOut="this.className='btn1_mouseout'" value="新增生产线 "></td>
					  	</tr>
				  </table>
		  	 </fieldset>
		  </form>
				<table width="100%" border=0 cellpadding=0 cellspacing=1
					bgcolor=5cb7fe>
					<!--DWLayoutTable-->
					<tr>
						<td width="30" height="25" align="center"
							bgcolor="#D8EDFF"><span class="STYLE1">序号 </span></td>
						<td width="107" height="25" align="center"
							bgcolor="#D8EDFF"><span class="STYLE1">生产线名称 </span></td>
				   		<td width="93" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">上线节点IP</span></td>
						<td width="93" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">下线节点IP</span></td>
						<td width="93" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">返修上线节点IP</span></td>
						<td width="93" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">返修下线节点IP</span></td>
						<td width="93" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">操作</span></td>
					</tr>
					<s:iterator value="pls" status="pl">
					<tr>
					  <td height="25" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="#pl.count"/></span></td>
					  <td height="25" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="lineName"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="node2IP"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="node3IP"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="node6IP"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="node4IP"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">
							<a href="javascript:void(0)"><img src="images/edit.gif" onclick='fn_edit(<s:property value="id"/>,"<s:property escape="0" value="lineName"/>","<s:property escape="0" value="node2IP"/>","<s:property escape="0" value="node3IP"/>","<s:property escape="0" value="node6IP"/>","<s:property escape="0" value="node4IP"/>")' /></img></a>&nbsp;&nbsp;
							<a href="javascript:void(0)"><img src="images/delete.gif" onclick='fn_delete(<s:property value="id"/>,"<s:property escape="0" value="lineName"/>")' /></img></a></span></td>
				  </tr>
				  </s:iterator>
				</table>
				</td>
				<td width="50">&nbsp;</td>
				<td>&nbsp;</td>
			</tr>
</table>
		</td>
		<td valign="top" background="images/icon6.jpg"><img
			src="images/icon6.jpg" width="5" height="100" /></td>
	</tr>

	<tr>
		<td height="5"></td>
		<td valign="top"><img src="images/icon7.jpg" width="5" height="5" /></td>
		<td colspan="3" valign="top"><img src="images/icon8.jpg" width="100%"
			height="5" /></td>
		<td valign="top"><img src="images/icon9.jpg" width="5" height="5" /></td>
	</tr>
	<tr>
		<td height="2"></td>
		<td></td>
		<td width="1"></td>
		<td width="6"></td>
		<td></td>
		<td></td>
	</tr>
</table>
</body>
</html>
